<!DOCTYPE html>
<html class="bootstrap-admin-vertical-centered">
    <head>
        <title>物流商登录</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="/public/logistics/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="/public/logistics/css/bootstrap-theme.min.css" rel="stylesheet" media="screen">
        <link href="/public/logistics/css/bootstrap-admin-theme.css" rel="stylesheet" media="screen">
        <link href="/public/logistics/css/message.css" rel="stylesheet" media="screen">

        <!-- Custom styles -->
        <style type="text/css">
            .alert{
                margin: 0 auto 20px;
            }
        </style>

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
           <script type="text/javascript" src="js/html5shiv.js"></script>
           <script type="text/javascript" src="js/respond.min.js"></script>
        <![endif]-->
    </head>
    <body class="bootstrap-admin-without-padding">
        <div class="container">
            <div class="row">
                <form class="bootstrap-admin-login-form">
                    <h1 style=" text-align:center; ">物流供应商登录</h1>
                    <div class="form-group">
                        <input class="form-control" type="text" id="name" placeholder="登录用户名">
                    </div>
                    <div class="form-group">
                        <input class="form-control" type="password" id="pass" placeholder="登录密码">
                    </div>
                    <div class="form-group">
                        <label>
                            <input type="checkbox" name="remember_me">
                           记住密码
                        </label>
                    </div>
                    <button class="btn btn-lg btn-primary" id="login_submit" type="submit">提交</button>
                </form>
            </div>
        </div>

        <script type="text/javascript" src="/public/logistics/js/jquery-2.0.3.min.js"></script>
        <script type="text/javascript" src="/public/logistics/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="/public/logistics/js/message.js"></script>
        <script type="text/javascript">
            $(function() {
                $('input[name="email"]').focus();
                var formWidth = $('.bootstrap-admin-login-form').innerWidth();
                var alertPadding = parseInt($('.alert').css('padding'));
                $('.alert').width(formWidth - 2 * alertPadding);
            });
			$("#login_submit").click(function(){
				var name = $("#name").val();
				if( name == '' ) {
					$.message({
						message:'登录用户名不能为空',
						type:'warning'
					});
					return false;
				}
				var pass = $("#pass").val();
				if( pass == '' ) {
					$.message({
						message:'登录密码不能为空',
						type:'warning'
					});
					return false;
				}
				$.post("{:U("public/login_post")}" , { name: name , pass : pass } , function(data){
					if( data.status == 1 ) {
						$.message('成功');
						setTimeout( function(){
							location.href="{:U("index/index")}";
						},1500);
					} else{
						$.message({
							message:data.info,
							type:'error'
						});
					}
				},"json");
				return false;
			});
        </script>
    </body>
</html>
